#include "header.h"

void Stack::Push()
{
	int _val;

	cout<<"Push <-- ";
	cin>>_val;

	value = _val;
}
int Stack::Pop(int _count)
{
	if(_count>0){
		cout<<"Pop --> "<<value<<endl;
		
		return --(_count);
	}
	else{
		ErrorMsg();
		return _count;
	}
}
void Stack::Top(int _count) const
{
	if(_count>0){
		cout<<"Top --- "<<value<<endl;
	}
	else{
		ErrorMsg();
	}
}
void Stack::ErrorMsg() const
{
	cout<<"Stack is Empty!"<<endl;
}